Ext.regModel('File', {
    idProperty: 'id',
    fields: [
        {name: 'id',       type: 'string'},
        {name: 'fileName', type: 'string'}
    ]
});


Ext.setup({
    icon: 'icon.png',
    tabletStartupScreen: 'tablet_startup.png',
    phoneStartupScreen: 'phone_startup.png',
    glossOnIcon: false,
    onReady: function () {
    	var toolbar = new Ext.Toolbar({
    		title: 'Olleh NFC',
    		dock: 'top',
    		items: [
				{
					xtype: 'button',
					text: 'back'
				},
				{ 
					xtype: 'spacer' 
				},
				{
					xtype: 'button',
					text: 'About'
				}
			]
    	});
    	
/*    	var tabpanel = new Ext.TabPanel({
    		fullscreen: true,
    		ui: 'dark',
    		cardSwitchAnimation:
    		{ type: 'slide' },
    		defaults:
    		{ scroll: 'vertical' },
    		tabBar: {
    		dock: 'bottom',
    		layout: { pack: 'center' }
    		}
    		});*/
    		
    	/*var panel = new Ext.TabPanel({
	    	fullscreen: true,
	    	ui: 'dark',
	    	cardSwitchAnimation:
	    	{ type: 'slide' },
	    	
	    	defaults:
    		{ scroll: 'vertical' },
	    	dockedItems: [toolbar],
	    	tabBar: {
	    		dock: 'bottom',
	    		layout: { pack: 'center' }
	    	},
			item : [ 
				{
					title : 'Orientation',
					iconCls : 'locate',
					scroll : false,
					dockedItems : [ 
						{
							xtype : 'toolbar',
							dock : 'top',
							title : 'Orientation'
						} 
					]
				} 
			]
    	});*/
    	
    	
    	
    	var tabpanel = new Ext.TabPanel({
    		fullscreen: true,
    		ui: 'dark',
    		cardSwitchAnimation: { type: 'slide' },
    		defaults: { scroll: 'vertical' },
    		tabBar: {
	    		dock: 'bottom',
	    		layout: { pack: 'center' }
    		},
    		items: [{
	    		title: 'Orientation',
	    		iconCls: 'locate',
	    		scroll: true,
	    		dockedItems: [{ 
	    			xtype: 'toolbar', 
	    			dock: 'top',
	    			title: 'Orientation'
	    		}],
	    		html : '<iframe src="http://m.naver.com" scrolling="no" marginwidth="0" marginheight="0" frameborder="0" vspace=0" hspace="0" style="width:100%;height:100%"></iframe>',
	    		layout: {
	    			type: 'vbox',
	    			align: 'stretch'
	    		}
	    		
    		}]
    	});
    		
    }
    
    /*
	 * onReady: function(){
	 * 
	 * var store = new Ext.data.TreeStore({ model: 'File', proxy: { type:
	 * 'ajax', url: 'getSourceFiles.php', reader: { type: 'tree', root:
	 * 'children' } } });
	 * 
	 * 
	 * var nestedList = new Ext.NestedList({ fullscreen: true, title: 'src/',
	 * displayField: 'fileName', // add a / for folder nodes in title/back
	 * button getTitleTextTpl: function() { return '{' + this.displayField + '}<tpl
	 * if="leaf !== true">/</tpl>'; }, // add a / for folder nodes in the list
	 * getItemTextTpl: function() { return '{' + this.displayField + '}<tpl
	 * if="leaf !== true">/</tpl>'; }, // provide a codebox for each source
	 * file getDetailCard: function(record, parentRecord) { return new
	 * Ext.ux.CodeBox({ value: 'Loading...', scroll: { direction: 'both',
	 * eventTarget: 'parent' } }); }, store: store });
	 * 
	 * 
	 * nestedList.on('leafitemtap', function(subList, subIdx, el, e, detailCard) {
	 * var ds = subList.getStore(), r = ds.getAt(subIdx);
	 * 
	 * Ext.Ajax.request({ url: '../../src/' + r.get('id'), success:
	 * function(response) { detailCard.setValue(response.responseText); },
	 * failure: function() { detailCard.setValue("Loading failed."); } }); }); }
	 */
});